package com.light.music;

import android.R;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;


public class BackGroundMusicController
{
	public static MediaPlayer mediaPlayer = null;
	public static boolean turnOffOnPause = true;
	
	public static void Play()
	{ 
		if (mediaPlayer != null && !mediaPlayer.isPlaying())
			mediaPlayer.start(); 
	}
	public static void Stop() 
	{
		if (mediaPlayer != null && mediaPlayer.isPlaying())
			mediaPlayer.stop(); 
	}
	public static void changeMusic(MediaPlayer mp) { 
		if (mediaPlayer != null)
		{
			Stop();
			mediaPlayer.release();
			mediaPlayer = null;
		}
		mediaPlayer = mp;
	}
	
	public static void pause()
	{
		if (mediaPlayer != null && mediaPlayer.isPlaying())
			mediaPlayer.pause(); 
	}
	
	public static void setVolume(float volume)
	{
		if (mediaPlayer != null)
			mediaPlayer.setVolume(volume, volume);
	}
}
